package org.example.bean;

import org.example.utils.PropertiesUtils;

public class Constants {
    public static Boolean IGNORE_TABLE_PREFIX;
    public static String SUFFIX_BEAN_QUERY;
    public static String PATH_JAVA = "java";
    public static String PATH_RESOURCES = "resources";
    public static String PATH_BASE;
    public static String PATH_PO;
    public static String PACKAGE_BASE;
    public static String PACKAGE_PO;
    public static String PACKAGE_QUERY;
    public static String PATH_QUERY;
    //需要忽略的属性
    public static  String IGNORE_BEAN_TOJSON_FIELD;
    public static  String IGNORE_BEAN_TOJSON_EXPRESSION;
    public static  String IGNORE_BEAN_TOJSON_CLASS;
    //日期序列化 反序列化
    public static  String BEAN_DATE_FORMAT_EXPRESSION;
    public static  String BEAN_DATE_FORMAT_CLASS;
    public static  String BEAN_DATE_UNFORMAT_EXPRESSION;
    public static  String BEAN_DATE_UNFORMAT_CLASS;
    public static  String SUFFIX_BEAN_QUERY_FUZZY;
    public static  String SUFFIX_BEAN_QUERY_TIME_START;
    public static  String SUFFIX_BEAN_QUERY_TIME_END;
    public static  String SUFFIX_MAPPER;
    public static  String PACKAGE_UTILS;
    public static  String PATH_UTILS;
    public static  String PACKAGE_ENUMS;
    public static  String PATH_ENUMS;
    public static  String PACKAGE_MAPPER;
    public static  String PATH_MAPPER;
    public static  String PATH_MAPPER_XML;
    public static  String PACKAGE_SERVICE;
    public static  String PATH_SERVICE;
    public static  String PACKAGE_SERVICE_IMPL;
    public static  String PATH_SERVICE_IMPL;
    public static  String PACKAGE_CONTROLLER;
    public static  String PATH_CONTROLLER;
    public static  String PACKAGE_VO;
    public static  String PATH_VO;
    public static  String PACKAGE_EXCEPTION;
    public static  String PATH_EXCEPTION;






    static {
        IGNORE_TABLE_PREFIX = Boolean.valueOf(PropertiesUtils.getString("ignore.table.prefix"));
        SUFFIX_BEAN_QUERY = PropertiesUtils.getString("suffix.bean.query");

        //需要忽略的属性
        IGNORE_BEAN_TOJSON_FIELD = PropertiesUtils.getString("ignore.bean.tojson.field");
        IGNORE_BEAN_TOJSON_EXPRESSION = PropertiesUtils.getString("ignore.bean.tojson.expression");
        IGNORE_BEAN_TOJSON_CLASS = PropertiesUtils.getString("ignore.bean.tojson.class");
        //日期序列化 反序列化
        BEAN_DATE_FORMAT_EXPRESSION = PropertiesUtils.getString("bean.date.format.expression");
        BEAN_DATE_FORMAT_CLASS = PropertiesUtils.getString("bean.date.format.class");
        BEAN_DATE_UNFORMAT_EXPRESSION = PropertiesUtils.getString("bean.date.unformat.expression");
        BEAN_DATE_UNFORMAT_CLASS = PropertiesUtils.getString("bean.date.unformat.class");
        //参数模糊搜索后缀
        SUFFIX_BEAN_QUERY_FUZZY = PropertiesUtils.getString("suffix.bean.query.fuzzy");
        //参数日期起止
        SUFFIX_BEAN_QUERY_TIME_START = PropertiesUtils.getString("suffix.bean.query.time.start");
        SUFFIX_BEAN_QUERY_TIME_END = PropertiesUtils.getString("suffix.bean.query.time.end");
        //mapper
        SUFFIX_MAPPER = PropertiesUtils.getString("suffix.mapper");


        PACKAGE_BASE = PropertiesUtils.getString("package.base");
        PACKAGE_PO = PACKAGE_BASE + "."+ PropertiesUtils.getString("package.po");

        PATH_BASE = PropertiesUtils.getString("path.base");
        PATH_BASE = PATH_BASE  +PATH_JAVA+"/" +  PACKAGE_BASE.replace(".","/");

        PATH_MAPPER_XML = PropertiesUtils.getString("path.base")  + PATH_RESOURCES + "/" + PropertiesUtils.getString("package.mapper");;






        PATH_PO = PATH_BASE + "/" + PropertiesUtils.getString("package.po").replace(".","/");

        PACKAGE_QUERY =PACKAGE_BASE + "."+PropertiesUtils.getString("package.query");
        PATH_QUERY = PATH_BASE + "/" + PropertiesUtils.getString("package.query").replace(".","/");

        PACKAGE_MAPPER =PACKAGE_BASE + "."+PropertiesUtils.getString("package.mapper");
        PATH_MAPPER = PATH_BASE + "/" + PropertiesUtils.getString("package.mapper").replace(".","/");

        PACKAGE_UTILS = PACKAGE_BASE +"."+ PropertiesUtils.getString("package.utils");
        PATH_UTILS = PATH_BASE + "/" + PropertiesUtils.getString("package.utils");

        PACKAGE_ENUMS = PACKAGE_BASE + "." +PropertiesUtils.getString("package.enums");
        PATH_ENUMS = PATH_BASE + "/" + PropertiesUtils.getString("package.enums");

        PACKAGE_SERVICE = PACKAGE_BASE +"."+ PropertiesUtils.getString("package.service");
        PACKAGE_SERVICE_IMPL = PACKAGE_SERVICE + "." + PropertiesUtils.getString("package.service.impl");

        PATH_SERVICE = PATH_BASE + "/" +PropertiesUtils.getString("package.service");
        PATH_SERVICE_IMPL = PATH_SERVICE + "/" +PropertiesUtils.getString("package.service.impl");

        PACKAGE_CONTROLLER = PACKAGE_BASE + "." +PropertiesUtils.getString("package.controller");
        PATH_CONTROLLER = PATH_BASE + "/" + PropertiesUtils.getString("package.controller");

        PACKAGE_VO = PACKAGE_BASE + "." + PropertiesUtils.getString("package.vo");
        PATH_VO = PATH_BASE + "/" + PropertiesUtils.getString("package.vo").replace(".","/");

        PACKAGE_EXCEPTION = PACKAGE_BASE+"." + PropertiesUtils.getString("package.exception");
        PATH_EXCEPTION = PATH_BASE + "/" + PropertiesUtils.getString("package.exception").replace(".","/");
    }

    public static String[] SQL_DATE_TIME_TYPES = new String[]{"datetime","timestamp"};
    public static String[] SQL_DATE_TYPES = new String[]{"date"};

    public static String[] SQL_DECIMAL_TYPE = new String[]{"decimal","double","float"};

    public static String[] SQL_STRING_TYPE = new String[]{"char","varchar","text","mediumtext","longtext"};


    public static String[] SQL_INTEGER_TYPE = new String[]{"int","tinyint"};
    public static String[] SQL_LONG_TYPES= new String[]{"bigint"};

    public static void main(String[] args) {
        System.out.println(PACKAGE_SERVICE);
        System.out.println(PATH_SERVICE);
        System.out.println(PACKAGE_SERVICE_IMPL);
        System.out.println(PATH_SERVICE_IMPL);
        System.out.println(PACKAGE_CONTROLLER);
        System.out.println(PATH_CONTROLLER);
        System.out.println(PACKAGE_VO);
        System.out.println(PATH_VO);
        System.out.println(PACKAGE_EXCEPTION);
        System.out.println(PATH_EXCEPTION);

    }

}
